package com.wwj.controller.user;

import com.wwj.common.result.PageResult;
import com.wwj.common.result.Result;
import com.wwj.pojo.dto.ReportDTO;
import com.wwj.pojo.dto.ReportPageQueryDTO;
import com.wwj.service.ReportService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

@RestController("userReportController")
@RequestMapping("/user/report")
@Slf4j
@Api(tags="体检报告相关接口")
public class ReportController {

    @Resource
    private ReportService reportService;



    @GetMapping("/page")
    @ApiOperation(value = "体检报告分页查询")
    @Cacheable(cacheNames = "ReportCache",key = "#reportPageQueryDTO.userId")
    public Result<PageResult> Page(ReportPageQueryDTO reportPageQueryDTO){

        PageResult pageResult= reportService.pageQueryUser(reportPageQueryDTO);

        return Result.success(pageResult);

    }

}
